package com.yans.views.display
{ 
	import flash.geom.Point;
	
	import org.osmf.net.StreamingURLResource;

	public class SwfLoaderKey
	{
		private var _path:String;
		private var _main:String;
		private var _sub:String;
		private var _offset:Point;
		private var _callBack:Function;
		private var _loader:SwfLoader;
		private var _frames:Array;
		
		public var label:String;
		
		public var data:BitmapFrameData;
		
		public function toKey():String {
			return _path + "/" + _main + "/" + _sub;
		}
		
		public function get path():String {
			return _path;
		}
		
		public function get main():String {
			return _main;
		}
		
		public function get sub():String {
			return _sub;
		}
		
		public function get offset():Point {
			return _offset;
		}
		
		public function get frames():Array {
			return _frames;
		}
		
		public function get callBack():Function {
			return _callBack;
		}
		
		public function setLoder(loader:SwfLoader):void {
			_loader = loader;
		}
		
		public function get loader():SwfLoader {
			return _loader;
		} 
		
		public function SwfLoaderKey(path:String, main:String, sub:String, callBack:Function, offset:Point = null, frames:Array = null)
		{
			_path = path;
			_main = main;
			_sub = sub;
			_callBack = callBack;
			_offset = offset;
			_frames = frames;
		}
		
		public function clone(main:String = null, sub:String = null):SwfLoaderKey {
			var key:SwfLoaderKey = new SwfLoaderKey(_path, main, sub, callBack, offset, _frames);
			key.setLoder(_loader);
			return key;
		}
		
		public function toMovie():BitmapMovie {
			if(!data) return null;
			return BitmapMovie(data);
		}
	}
}